home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 316 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: stern.fokus.gmd.de!news
  2. From: Watson <sayegh@fokus.gmd.de>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: ugly constants and header files
  5. Date: Thu, 04 Jan 1996 11:36:03 +0100
  6. Organization: GMD FOKUS - Research Institute for Open Communication Systems
  7. Message-ID: <30EBAD93.3AA@fokus.gmd.de>
  8. References: <1996Jan3.155754.111142@kuhub.cc.ukans.edu>
  9. NNTP-Posting-Host: pollux.fokus.gmd.de
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b4 (X11; I; SunOS 5.4 sun4m)
  14.  
  15. anh@kuhub.cc.ukans.edu wrote:
  16.  
  17. > I have a list of constants, some defined using #define, some are string
  18. > constants a la char *gSuperStrings[]={"aa","bb"};
  19. using #define in a header file is ok,
  20. but do not initialize variables in header files
  21. like you did it with gSuperStrings[].
  22.  
  23. > my_const.h        --- To be included only once (perferably by the main()
  24. >                       module). Definitions
  25. declare variables directly in your main()-module. I prefer
  26. to create a separate module vars.c.
  27.  
  28. > my_ext.h          --- To be included by any modules using the constants.
  29. >                       Declarations.
  30. That's perfect :-)
  31.  
  32. -- 
  33. *    Greetinx,
  34.     Watson (sayegh@fokus.gmd.de)
  35.     more personal details at:
  36.     http://www.fokus.gmd.de/ovma/employees/sayegh/entry.html
  37.